<?php

use Drupal\shusy_product\Entity\ShusyProduct;
use Drupal\shusy_product\Entity\ShusyProductComment;
use Drupal\shusy_product\Entity\ShusyProductStandard;

function shusy_product_shusy_product_add_page() {
  $e = new ShusyProduct();
  module_load_include('inc', 'shusy_product', 'shusy_product.forms');
  return drupal_get_form('shusy_product_shusy_product_entity_form', $e, 'add');
}

function shusy_product_shusy_product_view_page(ShusyProduct $e) {
  return entity_view($e->entityType(), [$e]);
}

function shusy_product_shusy_product_edit_page(ShusyProduct $e) {
  module_load_include('inc', 'shusy_product', 'shusy_product.forms');
  return drupal_get_form('shusy_product_shusy_product_entity_form', $e, 'edit');
}

function shusy_product_shusy_product_edit2_page(ShusyProduct $e) {
  module_load_include('inc', 'shusy_product', 'shusy_product.forms');
  return drupal_get_form('shusy_product_shusy_product_entity_form2', $e, 'edit');
}

function shusy_product_shusy_product_delete_page(ShusyProduct $e) {
  module_load_include('inc', 'shusy_product', 'shusy_product.forms');
  return drupal_get_form('shusy_product_shusy_product_delete_form', $e);
}

function shusy_product_shusy_product_comment_add_page() {
  $e = new ShusyProductComment();
  module_load_include('inc', 'shusy_product', 'shusy_product.forms');
  return drupal_get_form('shusy_product_shusy_product_comment_entity_form', $e, 'add');
}

function shusy_product_shusy_product_comment_view_page(ShusyProductComment $e) {
  return entity_view($e->entityType(), [$e]);
}

function shusy_product_shusy_product_comment_edit_page(ShusyProductComment $e) {
  module_load_include('inc', 'shusy_product', 'shusy_product.forms');
  return drupal_get_form('shusy_product_shusy_product_comment_entity_form', $e, 'edit');
}

function shusy_product_shusy_product_comment_delete_page(ShusyProductComment $e) {
  module_load_include('inc', 'shusy_product', 'shusy_product.forms');
  return drupal_get_form('shusy_product_shusy_product_comment_delete_form', $e);
}

function shusy_product_shusy_product_standard_view_page(ShusyProductStandard $e) {
  return entity_view($e->entityType(), [$e]);
}

function shusy_product_shusy_product_standard_edit_page(ShusyProductStandard $e) {
  $product = shusy_product_load($e->product_id);
  module_load_include('inc', 'shusy_product', 'shusy_product.forms');
  return drupal_get_form('shusy_product_shusy_product_standard_entity_form', $e, $product, 'edit');
}

function shusy_product_shusy_product_standard_delete_page(ShusyProductStandard $e) {
  module_load_include('inc', 'shusy_product', 'shusy_product.forms');
  return drupal_get_form('shusy_product_shusy_product_standard_delete_form', $e);
}

function shusy_product_standard_add_page(ShusyProduct $shusyProduct) {
  $e = new ShusyProductStandard();
  $e->product_id = $shusyProduct->id;
  module_load_include('inc', 'shusy_product', 'shusy_product.forms');
  return drupal_get_form('shusy_product_shusy_product_standard_entity_form', $e, $shusyProduct, 'add');
}
